/**
 * Created by Administrator on 2017/7/20.
 */
require.config(window.jshead);
require(['jquery', 'pages', 'common', 'navigator'], function ($, pg, Common) {
    //页面进来的时候获取数据并且加载到页面上

    function threeNumber(str) {
        var str = str.split('').reverse().join('').replace(/(\d{3})/g, '$1,').replace(/\,$/, '').split('').reverse().join('');
        return str
    }
    $.ajax({
        type:'post',
        url:'/loan/repaymentStatistics',
        dataType:'json',
        success:function(data){
            if(data.sumAccout==''){
                $('#allMoney').html('￥'+0)
            }else{
                $('#allMoney').html('￥'+threeNumber(data.sumAccout.toString()))
            }
            $('#Allamount').html(data.loanCount)
            $('#PrincipalAndInterestReceived').html('￥'+data.actualAmountSum);
            $('#NumbeOfSuccessfulLoans').html(data.itemCount);
            $('#waitMoney').html('￥'+data.repayAmountSum);
            $('#normalMoney').html(data.normalRepayCount);
            $('#addFull').html(data.repayCount);//加权评论率
            $('#FullMoney').html(data.prepayCount)


        }
    })
});